//
//  RMMStoresTableViewCell.m
//  Romomo
//
//  Created by puman on 2017/2/19.
//  Copyright © 2017年 mazegong. All rights reserved.
//

#import "RMMStoresTableViewCell.h"

@implementation RMMStoresTableViewCell
{
    UILabel *_nameLabel;
    UILabel *_detailsLabel;
    UIImageView *_imageV;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _selectBUt = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _selectBUt.frame = CGRectMake(0, 20, 50, 50);
        _selectBUt.userInteractionEnabled = NO;
        [_selectBUt setImage:[UIImage imageNamed:@"可选@2x"] forState:(UIControlStateNormal)];
        [self.contentView addSubview:_selectBUt];
        
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_selectBUt.right, _selectBUt.top, kScreenWideth - _selectBUt.right - 115, 20)];
        _nameLabel.textColor = COLORFROMCODE(0x2B2B2B, 1);
        _nameLabel.font = kFont(16);
        [self.contentView addSubview:_nameLabel];
        
        _detailsLabel = [[UILabel alloc] initWithFrame:CGRectMake(_selectBUt.right, _nameLabel.bottom, kScreenWideth - _selectBUt.right - 15, 30)];
        _detailsLabel.textColor = COLORFROMCODE(0x9B9B9B, 1);
        _detailsLabel.font = kFont(12);
        _detailsLabel.numberOfLines = 0;
        [self.contentView addSubview:_detailsLabel];

        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(_selectBUt.right, _detailsLabel.bottom, 100, 30)];
        label.textColor = COLORFROMCODE(0x2B2B2B, 1);
        label.font = kFont(14);
        label.text = @"联系方式:";
        [self.contentView addSubview:label];

        _telBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _telBut.frame = CGRectMake(label.right, _detailsLabel.bottom, 100, 30);
        _telBut.titleLabel.font = kFont(12);
        _telBut.layer.cornerRadius = 13;
        _telBut.backgroundColor = kBasicColor;
        [_telBut setTitleColor:kWhiteColor forState:(UIControlStateNormal)];
        [self.contentView addSubview:_telBut];

        
        
    }
    return self;
}
- (void)setModel:(RMMStoresModel *)model{
    _nameLabel.text = model.Store_Name;
    _detailsLabel.text = model.Store_Address;
    [_telBut setTitle:model.Store_Tel forState:(UIControlStateNormal)];
    if ([model.isSelect isEqualToString:@"1"]) {
        [_selectBUt setImage:[UIImage imageNamed:@"选中@2x"] forState:(UIControlStateNormal)];
     } else {
        [_selectBUt setImage:[UIImage imageNamed:@"可选@2x"] forState:(UIControlStateNormal)];
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
